import actionTypes from "./actionTypes"
import http from '../../service/http'
export function LoadStudentAction(payload){
  return{
    type:actionTypes.LOAD_STUDENT_LIST,
    payload:payload,
  }
}
export function LoadStudentActionAsync(payload){
  return dispatch=>{
    return http.studentList(payload).then((res)=>{
      dispatch(LoadStudentAction(res.data))
    })
  }
}
export function DeleteStudentActionAsync(payload){
  return dispatch=>{
    return http.studentDelete(payload)
  }
}
export function AddStudentActionAsync(payload){
  return dispatch=>{
    return http.studentAdd(payload)
  }
}